<div class="row">
  <div class="col-8">
    <div class="form-group">
      <div class="input-group">
        <input id="search_input" type="text" class="form-control ">
        <div class="input-group-append">
          <button id="search_btn" type="button" class="btn btn-primary ">搜索</button>
          <button id="search_all_btn" type="button" class="btn btn-success ">显示全部</button>
        </div>
        <script>
          search_btn.onclick=function(){
            window.location.href='/admin/<%=api_name%>?dataName=<%=dataName%>&rule=<%=rule%>&q=' + search_input.value + '&start=1&count=<%=count%>'
          }
          search_all_btn.onclick=function(){
            window.location.href='/admin/<%= api_name%>?dataName=<%=dataName%>&start=1&count=<%=count%>'
          }
        </script>
      </div>
    </div> 
  </div>
  <div class="col-2"><a  class="btn btn-info" href="<%= '/admin/' + api_name + '/add?dataName=' + dataName + '&rule=time&q=' + q + '&start=' + start + '&count=' + count %>" role="button">添加</a></div>
  <div class="col-2">
    <div class="dropdown show">
      <a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        排序
      </a>
      <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
        <% if(api_name==='product'){%>
        <a class="dropdown-item" href="<%= '/admin/' + api_name + '?dataName=' + dataName + '&rule=title&q=' + q + '&start=' + start + '&count=' + count %>">标题</a>
        <a class="dropdown-item" href="<%= '/admin/' + api_name + '?dataName=' + dataName + '&rule=time&q=' + q + '&start=' + start + '&count=' + count %>">发布时间</a>
        <% }%>
        <% if(api_name==='user'){%>
          <a class="dropdown-item" href="<%= '/admin/' + api_name + '?dataName=' + dataName + '&rule=nikename&q=' + q + '&start=' + start + '&count=' + count %>">昵称</a>
          <a class="dropdown-item" href="<%= '/admin/' + api_name + '?dataName=' + dataName + '&rule=time&q=' + q + '&start=' + start + '&count=' + count %>">发布时间</a>
        <% }%>
        <% if(api_name==='banner'){%>
          <a class="dropdown-item" href="<%= '/admin/' + api_name + '?dataName=' + dataName + '&rule=detail.auth&q=' + q + '&start=' + start + '&count=' + count %>">作者</a>
          <a class="dropdown-item" href="<%= '/admin/' + api_name + '?dataName=' + dataName + '&rule=time&q=' + q + '&start=' + start + '&count=' + count %>">发布时间</a>
        <% }%>
      </div>
    </div>
  </div>
</div>